<?php
header('Content-Type: text/html; charset=iso-8859-1');
header("Cache-Control: no-cache");
header("Pragma: no-cache");

session_start();

$caminho = realpath(dirname(__FILE__));
if (strpos($caminho, "MaisNotaWebFlex_IESAM"))
	{$_SESSION["idescola"] = 'local';}
	
else if(strpos($caminho, "iesam"))
	{$_SESSION["idescola"] = 'iesam';}
	
else if(strpos($caminho, "equipemacapa"))
	{$_SESSION["idescola"] = 'equipemacapa';}

else if(strpos($caminho, "estratego"))
	{$_SESSION["idescola"] = 'estratego';}	
	
else if(strpos($caminho, "fabel"))
	{$_SESSION["idescola"] = 'fabel';}
		
else if(strpos($caminho, "iespes"))
	{$_SESSION["idescola"] = 'iespes';}
	
else if(strpos($caminho, "cepes"))
	{$_SESSION["idescola"] = 'cepes';}

else if(strpos($caminho, "demo"))
	{$_SESSION["idescola"] = 'demo';}

else if(strpos($caminho, "immes"))
	{$_SESSION["idescola"] = 'immes';}
	
else if(strpos($caminho, "faculdademeta"))
	{$_SESSION["idescola"] = 'faculdademeta';}

else if(strpos($caminho, "equipemacapa"))
	{$_SESSION["idescola"] = 'equipemacapa';}	

else if(strpos($caminho, "istbraganca"))
	{$_SESSION["idescola"] = 'istbraganca';}



//require_once 'MaisWeb/amfphp/services/FuncAluno.php';
//require_once 'consulta/amfphp/services/FuncAluno.php';
require_once '../diarioweb/amfphp/services/FuncNotas.php';

/*
header('Content-type: application/pdf');
header('Content-Type: application/force-download');
header('Content-Type: application/octet-stream');
header('Content-Type: application/download');
header('Content-Description: File Transfer');
header("Content-Disposition: inline; filename=".$wpdf.".pdf"); 
*/

?>
<html>
<head>
<title>Boletim</title>
<style type="text/css">
	body{
		margin: 0 0 0 0;
		font-size: 9px;
		font-family: Verdana, Arial, Helvetica, sans-serif;
	}
	
	.rowDiscip
	{
		font-size: 9px;
	}
	
	.rowBoleti
	{
		font-size: 9px;
		text-align: center;
	}
	
	
	.bordaBoletim {border: 1px solid #000000;}
	
	.cabBoletim {background-color: #CFCFCF;}
	
	.tabelaBoletim tr td
	{
		border-bottom: 1px solid #000000;
	}
	
	
</style>
</head>

<body >
<?php
//ob_start();  //inicia o buffer
?>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="0">
  <tr bgcolor="#FFFFFF"> 
    <td valign="top">
		<?php

		$alunos = FuncNotas::getTodosAlunos();

		?>  
	</td>
  </tr>
  <tr> 
    <td height="230" valign="top" bgcolor="#FFFFFF"> 
      <div align="right"> </div>
      <div align="justify"><font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif"></font></div>
      <div align="center"> 
        <table width="100%" border="0" cellspacing="2" cellpadding="3">
			<tr> 
				<td align="center">
					<table border="0" cellspacing="0" cellpadding="0">
						<tr> 
							<td align="center" style="text-align: center;">
								<h3>Lista de Senhas</h3>
							</td>
						</tr>
					</table>
				</td>
			</tr>
          <tr> 
            <td height="163" valign="top" class="bordaBoletim"> 
				<table  border="1" align="center" cellpadding="0" cellspacing="0" class="tabelaBoletim">
					<tr > 
						<td width="120" class="cabBoletim"> 
							<b>Matr&Iacute;cula</b>
						</td>
                        <td width="500" class="cabBoletim">  
                       	    <b>Nome</b>
                        </td>
                        <td width="120" class="cabBoletim">  
                            <b>Senha</b>
                        </td>
					</tr>
                <? foreach ($alunos as $dados){ ?>
	            <tr> 					
					<td class="rowDiscip"><? echo $dados['matric']; ?></td>					
					<td class="rowBoleti"><? echo $dados['nome']; ?></td>				
					<td class="rowBoleti"><? echo $dados['sit']; ?></td>				  
                </tr>
                <? } ?>
              </table>
			  <br />
				<br />
				<br />
              </td>
          </tr>
        </table>
      </div></td>
  </tr>
</table>
</body>

</html>
<?php
//$html = ob_get_clean();
// pega o conteudo do buffer, insere na variavel e limpa a memória

//$html = utf8_encode($html);
// converte o conteudo para uft-8	 

//$mpdf = new mPDF('','A4', 0, '', 5, 5, 6, 6, 9, 9, 'P');
// cria o objeto

//$mpdf->allow_charset_conversion=true;
// permite a conversao (opcional)

//$mpdf->charset_in='UTF-8';
// converte todo o PDF para utf-8

//$mpdf->WriteHTML($html);
// escreve definitivamente o conteudo no PDF

//$mpdf->Output();
// imprime

//exit();
// finaliza o codigo
?>